import addr from '../apiConfig';
import { axios } from '../libs/axiosSetting';

export function page(params) {
  return axios.get(addr+'/a/role/page', {
    params: params,
  });
}

export function update(params) {
  return axios({
    url: addr+'/a/role/update',
    method: 'post',
    data: params,
  });
}

export function insert(params) {
  return axios({
    url: addr+'/a/role/insert',
    method: 'post',
    data: params,
  });
}


export function del(params) {
  return axios.get(addr+'/a/role/delete', {
    params: params,
  });
}


export function authorizedUser(params) {
  return axios.get(addr+'/a/role/users', {
    params: params,
  });
}


export function roleMenus(params) {
  return axios.get(`${addr}/a/role/menu`, {
    params: params,
  });
}


export function auth(params) {
  return axios({
    url: `${addr}/a/role/auth`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: params,
  });
}
export function assign(params) {
  return axios({
    url: `${addr}/a/role/assign`,
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
    data: params,
  });
}

